package edu.biwu.service.impl;


import edu.biwu.config.SpringConfig;
import edu.biwu.service.ProductService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author 王俊彪
 * @version 1.0
 */
@RunWith(SpringJUnit4ClassRunner.class)//切换到spring的测试框架
//@ContextConfiguration("classpath:applicationContext.xml")//加载配置文件
@ContextConfiguration(classes = SpringConfig.class)
public class ProductServiceImplSpringTest01 {
    @Autowired
    ProductService productService;

    @Test
    public void testFindAll(){
        productService.findAll().forEach(System.out::println);
    }
}
